﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class CMS_Admin_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Usas.Common.Cms.CurrentInfo cinfo = new Usas.Common.Cms.CurrentInfo();
            string role_url = "";
            if (cinfo.GetAdminGroup())
            {
                role_url = " var _menus = { \"menus\": [{ \"menuid\": \"1\", \"icon\": \"icon-sys\", \"menuname\": \"内容管理\", " +
                           " \"menus\": [{ \"menuname\": \"列表 待审核\", \"icon\": \"icon-add\", \"url\": \"CmsManager.aspx?a=c&c=s\" }, " +
                                    "{ \"menuname\": \"我发布的内容\", \"icon\": \"icon-set\", \"url\": \"MyPublic.aspx\" } " +
                                "]},{ \"menuid\": \"3\", \"icon\": \"icon-sys\", \"menuname\": \"页面设置\", " +
                            "    \"menus\": [{ \"menuname\": \"首页设置\", \"icon\": \"icon-nav\", \"url\": \"PageSetting.aspx?page=Default.aspx\" } " +
                                    "] " +
                            "}, { \"menuid\": \"4\", \"icon\": \"icon-sys\", \"menuname\": \"平台统计\", " +
                            "    \"menus\": [{ \"menuname\": \"时段分析\", \"icon\": \"icon-nav\", \"url\": \"../../Stat/DayStat.aspx\" }, " +
                             "   { \"menuname\": \"回访统计\", \"icon\": \"icon-nav\", \"url\": \"../../Stat/IpStat.aspx\" }, " +
                             "   { \"menuname\": \"客户端分析\", \"icon\": \"icon-nav\", \"url\": \"../../Stat/ClientStat.aspx\" }, " +
                              "   { \"menuname\": \"人员查询\", \"icon\": \"icon-nav\", \"url\": \"../../Stat/EmpStat.aspx\" }, " +
                             "   { \"menuname\": \"文章发布统计\", \"icon\": \"icon-nav\", \"url\": \"../../Stat/ArticlePublic.aspx\" }, " +
                           "   { \"menuname\": \"文章类型统计\", \"icon\": \"icon-nav\", \"url\": \"../../Stat/CmsTypeStat.aspx\" }" +
                            "		] " +
                            "}]};";
            }
     
            if (cinfo.GetSuperAdminGroup())
            {
                role_url = " var _menus = { \"menus\": [" +
                        "{ \"menuid\": \"1\", \"icon\": \"icon-sys\", \"menuname\": \"内容管理\", " +
                           " \"menus\": [{ \"menuname\": \"目录 当前显示\", \"icon\": \"icon-nav\", \"url\": \"CmsManager.aspx?a=d\" }, " +
                                    "{ \"menuname\": \"目录 回收站\", \"icon\": \"icon-users\", \"url\": \"CmsManager.aspx?a=h\" }, " +
                                    "{ \"menuname\": \"列表 回收站\", \"icon\": \"icon-role\", \"url\": \"DeleteList.aspx\" }, " +
                                    "{ \"menuname\": \"列表 待审核\", \"icon\": \"icon-add\", \"url\": \"CmsManager.aspx?a=c&c=s\" }, " +
                                    "{ \"menuname\": \"列表 待审核 admin\", \"icon\": \"icon-add\", \"url\": \"CmsManager.aspx?a=c&c=a\" }, " +
                                    "{ \"menuname\": \"我发布的内容\", \"icon\": \"icon-set\", \"url\": \"MyPublic.aspx\" } " +
                                "] " +
                        "}, { \"menuid\": \"3\", \"icon\": \"icon-sys\", \"menuname\": \"页面设置\", " +
                        "    \"menus\": [{ \"menuname\": \"首页设置\", \"icon\": \"icon-nav\", \"url\": \"PageSetting.aspx?page=Default.aspx\" } " +
                                "] " +
                        "}, { \"menuid\": \"4\", \"icon\": \"icon-sys\", \"menuname\": \"平台统计\", " +
                        "    \"menus\": [{ \"menuname\": \"时段分析\", \"icon\": \"icon-nav\", \"url\": \"../../Stat/DayStat.aspx\" }, " +
                         "   { \"menuname\": \"回访统计\", \"icon\": \"icon-nav\", \"url\": \"../../Stat/IpStat.aspx\" }, " +
                         "   { \"menuname\": \"客户端分析\", \"icon\": \"icon-nav\", \"url\": \"../../Stat/ClientStat.aspx\" }, " +

                          "   { \"menuname\": \"人员查询\", \"icon\": \"icon-nav\", \"url\": \"../../Stat/EmpStat.aspx\" }, " +
                         "   { \"menuname\": \"文章发布统计\", \"icon\": \"icon-nav\", \"url\": \"../../Stat/ArticlePublic.aspx\" }, " +
                       "   { \"menuname\": \"文章类型统计\", \"icon\": \"icon-nav\", \"url\": \"../../Stat/CmsTypeStat.aspx\" }" +

                        "		] " +
                        "}]};";
            }

            ClientScript.RegisterStartupScript(GetType(), "Msg", role_url, true);
        }
    }



    //private void Bind()
    //{
    //    Response.Write("<html><title>USAS内容管理</title><frameset cols=\"209,*\" border=\"0\">" +
    //   "<frame src=\"left.aspx\" noresize >" +
    //   "<frame src=\"right.aspx\" noresize border=\"0\" frameborder=\"0\" name=\"main\">" +
    //    "</frameset></html>");
    //}
}
